<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Vue.js</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <link rel="stylesheet" href="style.css" />
    <script src="vue.js"></script>
  </head>
  <body onload="draw()">
    <div id="vue-app"></div>
    <canvas id="canvas" width="800" height="600">
      你这浏览器不支持这玩意啊
    </canvas>
    <!-- <img src="fitness.jpg" alt=""> -->
    <script src="app.js"></script>
    <script>
      function draw() {
        // 让vscode可以显示canvas智能提示
        /** @type {HTMLCanvasElement} */
        const canvas = document.getElementById('canvas')
        if (canvas.getContext) {
          const ctx = canvas.getContext('2d')
          
          const img = new Image();
          img.src = "fitness.jpg";
          
          img.onload = function(){
            
            ctx.arc(400,300,150,0,Math.PI*2)
            // ctx.fill(); 这句话图像不显示会显示黑色.
            ctx.clip();
            ctx.drawImage(this,0,0);
            
          }
        }
      }
    </script>
  </body>
</html>
